﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Comissoes.Models.ClientesModel>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <%= ViewData["scripts"] %>
</head>
<body>
    <div class="cabecalho ui-state-highlight">
        <span class="icolst" />
        <span class="txt">
            <%= Html.Encode("Edição de Clientes") %>
        </span>
    </div>    
    <form action="javascript:saveDialog('Clientes', <%= Html.Encode(Model.cliente.COD_CLI) %>)">
        <fieldset class="container transparent">
            <label class="input160">
                <button class="diskcommand" type="submit"">Salvar</button>
                <% if (Model.cliente.COD_CLI == 0)
                   { %>                    
                    <button class="closecommand" type="button" onclick="loadOption('/Clientes/Index', true);">Cancelar</button>
                <% }
                   else
                   { %>
                    <button class="closecommand" type="button" onclick="loadOption('/Clientes/Details/<%= Html.Encode(Model.cliente.COD_CLI) %>', true);">Cancelar</button>
                <% } %>
            </label>
        </fieldset>
        <fieldset class="container field520 border ui-widget-content ui-corner-all">
            <% if (Model.cliente.COD_CLI != 0)
               { %>
                <%= Html.Label("COD_CLI", "for80", "Código:") %>
                <%= Html.LabelInput(Html.TextBox("COD_CLI", Model.cliente.COD_CLI, new { readOnly = true }), "input100 right integer") %>
            <% } %>

            <label class="space"></label>            

            <%= Html.Label("DATAULTVIS_CLI", "for80 clear", "Última Visita:") %>
            <%= Html.LabelInput(Html.TextBox("DATAULTVIS_CLI", Model.cliente.DATAULTVIS_CLI.HasValue ? Model.cliente.DATAULTVIS_CLI.ToString() :DateTime.Now.ToShortDateString()), "input100 center calendar") %>

            <%= Html.Label("LIMITE_CLI", "for60 right", "Limite:") %>
            <%= Html.LabelInput(Html.TextBox("LIMITE_CLI", Model.cliente.LIMITE_CLI), "input100 right setfocus money") %>

            <%= Html.Label("ATIVO_CLI", "for80 right", "Ativo") %>
            <%= Html.LabelInput(Html.CheckBox("ATIVO_CLI", Model.cliente.ATIVO_CLI == "A" || string.IsNullOrEmpty(Model.cliente.ATIVO_CLI)), "Check") %>

            <% Html.RenderAction("Edit", "Pessoas", Model.cliente.PESSOAS); %>

            <fieldset class="container field250 border legend float">
                <%= Html.Legend("Interesse") %>

                <%= Html.LabelInput(Html.RadioButton("INTERESSE_CLI", "A", Model.cliente.INTERESSE_CLI == "A" || string.IsNullOrEmpty(Model.cliente.INTERESSE_CLI), new { id = "A" }), "Radio") %>
                <%= Html.Label("A", "for40", "Alto") %>
                <%= Html.LabelInput(Html.RadioButton("INTERESSE_CLI", "M", Model.cliente.INTERESSE_CLI == "M", new { id = "M" }), "Radio") %>
                <%= Html.Label("M", "for40", "Medio") %>
                <%= Html.LabelInput(Html.RadioButton("INTERESSE_CLI", "B", Model.cliente.INTERESSE_CLI == "B", new { id = "B" }), "Radio") %>
                <%= Html.Label("B", "for40", "Baixo") %>
            </fieldset>
        </fieldset>
    </form>
</body>
</html>